/***********************************************************************************/
/* Code license:  GNU General Public License v3                                    */
/* Main page:     https://code.google.com/p/library-cross-platform/                */
/* Issue tracker: https://code.google.com/p/library-cross-platform/issues/list     */
/***********************************************************************************/

#ifndef __CPP_FIND_POS_12_12_2012__
#define __CPP_FIND_POS_12_12_2012__


template <class type>
class FindPos
{
/*************************************************************************
DESCRIPTION:
 Find element in the input array.

IN:
  in     - input data.
  length - length of the input data
  val    - this value will be find

RETURN: return position of the found element in the array.
        if result is false then -1 will be returned.
*************************************************************************/
  virtual int findPos(const type *in, int length, const type &val) = 0;



/*************************************************************************
DESCRIPTION:
 Find position in the input array. In this position new element must be inserted,
 in this case sorted array will be kept.

IN:
  in     - input data.
  length - length of the input data
  val    - this value will be find

RETURN: return position which must be used to insert new element.
*************************************************************************/
  virtual int insert2Pos(const type *in, int length, const type &val) = 0;

/*************************************************************************
DESCRIPTION:
 Sort input array.

IN:
  in     - input data.
  length - length of the input data

RETURN: if OK return true otherwise false.
*************************************************************************/
  virtual bool sort(type *in, int length) = 0;

};

#endif //__CPP_FIND_POS_12_12_2012__
